Skip to content

fix(security): Migration auf @huggingface/transformers v4 + ner-worker-Build-Fix#4

Merged
Baldri merged 3 commits into
mainfrom
claude/session/feat/transformers-v4-migration
Jul 2, 2026
Merged

fix(security): Migration auf @huggingface/transformers v4 + ner-worker-Build-Fix#4
Baldri merged 3 commits into
mainfrom
claude/session/feat/transformers-v4-migration

Conversation

@Baldri

@Baldri Baldri commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Ersetzt den automatisch geschlossenen #3 (Base-Branch von #2 wurde nach Merge gelöscht). Inhalt unverändert — Details und Verifikation siehe #3.

Kurzfassung

  • @xenova/transformers 2.17.2 → @huggingface/transformers 4.2.0: eliminiert die komplette protobufjs-Critical-Kette, npm audit --omit=dev = 0 Vulnerabilities
  • Fixt den nie gebauten NER-Worker (build:ner-worker in Build-Chain) — 3-Layer-NER-Pfad war im Release-Build tot
  • Bestehender piiranha-v1-Cache wird ohne Re-Download weiterverwendet (offline verifiziert)
  • Gates: Typecheck ✅, Tests Exit 0 ✅, Build ✅, RUN_3LAYER-Red-Team: 42 Failures vs. 48 Baseline, alle 7 NER-Gewinne erhalten ✅
  • Review-Punkt: onnxruntime-node native Binaries beim nächsten dist:mac prüfen (asar-Unpack)

🤖 Generated with Claude Code

Baldri and others added 3 commits July 2, 2026 17:25
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Plan was fully implemented on 2026-03-17 (GitHub release v0.7.0,
mingly-website commit 02e6d22, preprocessor fixes shipped) but the
checkboxes were never ticked. Verified against live site, app and
release on 2026-07-02; marked done and committed as historical record.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces @xenova/transformers 2.17.2 with @huggingface/transformers 4.2.0
(the maintained successor). Eliminates the entire protobufjs critical
advisory chain (11 advisories incl. GHSA-xq3m-2v4x-88gg arbitrary code
execution) via @xenova -> onnxruntime-web -> onnx-proto -> protobufjs:
npm audit --omit=dev is now clean (0 vulnerabilities).

API changes: package rename in 4 dynamic imports; quantized:false ->
dtype:'fp32' (option removed in v3+). env.cacheDir/allowRemoteModels,
progress_callback, cache layout and token-classification output are
unchanged - the existing piiranha-v1 model cache is reused without
re-download.

Also fixes a latent build gap: dist/main/ner-worker.js was never built
(no esbuild entry), so NERDetector silently fell back to [] in packaged
builds - the 3-layer NER path was dead in production. New
build:ner-worker script is chained into build.

Verified: typecheck + full test suite green, build produces the worker
bundle, RUN_3LAYER=1 red-team run loads piiranha via the new library
from the existing cache (776ms) with 42 failures vs 48 in the 2026-03-17
baseline - all 7 documented NER-fixed tests still pass, no regressions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Baldri Baldri merged commit 5ae118c into main Jul 2, 2026
1 of 6 checks passed
@Baldri Baldri deleted the claude/session/feat/transformers-v4-migration branch July 2, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant